package org.example.forum.model;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import java.util.Date;

@Data
@Slf4j
@Schema(defaultValue = "用户信息")
public class User {
    private Long id;
    @Schema(defaultValue = "用户名")
    private String username;

    @JsonIgnore//不参与JSON序列化
    private String password;

    @Schema(defaultValue = "昵称")
    private String nickname;

    @Schema(defaultValue = "电话")
    private String phoneNum;

    private String email;

    private Byte gender;

    //不参与JSON序列化
    @JsonIgnore
    private String salt;

    //强制参与json序列化
    @JsonInclude(JsonInclude.Include.ALWAYS)
    private String avatarUrl;

    private Integer articleCount;

    private Byte isAdmin;

    private String remark;

    private Byte state;

    @JsonIgnore//不参与JSON序列化
    private Byte deleteState;

    private Date createTime;

    private Date updateTime;

}